package com.yimi.yinhepda.adapter.RecycleAdapter;

import android.content.Context;

import com.yimi.yinhepda.R;
import com.pda.ym.base.CommonRecycleAdapter;
import com.pda.ym.base.CommonViewHolder;
import com.yimi.yinhepda.entity.bean.NextDeptEntity;

import java.util.List;

/**
 * 创建配载：选择更多任务适配器
 *
 * @author 000432
 * @date 2018/6/1 0001
 */

public class SelectMoreTaskNoAdapter extends CommonRecycleAdapter<NextDeptEntity> {

    private CommonViewHolder.onItemCommonClickListener mCommonClickListener;

    public SelectMoreTaskNoAdapter(Context context, List<NextDeptEntity> dataList, CommonViewHolder.onItemCommonClickListener commonClickListener) {
        super(context, dataList, R.layout.adapter_select_next_dept_item);
        this.mCommonClickListener = commonClickListener;
    }

    @Override
    public void bindData(CommonViewHolder holder, NextDeptEntity data, int position) {
        holder.setCommonClickListener(mCommonClickListener);
        holder.setText(R.id.tv_next_dept, data.getNextDeptName());
        holder.setText(R.id.tv_plan_start_time, data.getPlanStartTime());
        if (data.getNextDeptCode().contains("UC") || data.getNextDeptCode().contains("uc")) {
            holder.setText(R.id.tv_dept_type, "快递");
        } else {
            holder.setText(R.id.tv_dept_type, "快运");
        }
    }
}
